//
//  MyTabInfoViewBase.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2020/9/10.
//  Copyright © 2020 moon. All rights reserved.
//

#import "MyTabInfoViewBase.h"

@implementation MyTabInfoViewBase
- (id)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        self.showMoreButton = [[MKUIFlowLayoutButton alloc] init];
        [self.showMoreButton setTitle:@"More" forState:UIControlStateNormal];
        [self.showMoreButton setTitle:@"Less" forState:UIControlStateSelected];
        [self.showMoreButton setTitleColor:[UIColor systemBlueColor] forState:UIControlStateNormal];
        [self.contentView addSubview:self.showMoreButton];
        //
        self.flowlayout = [[MKUIFlowLayoutConstraint alloc] initWithItems:@[self.showMoreButton] constraintParam:(MKUIFlowLayoutConstraintParam_V_T_C) contentInsets:UIEdgeInsetsZero interitemSpacing:5];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    CGRect bounds = self.contentView.bounds;
    self.flowlayout.bounds = bounds;
    [self.flowlayout layoutItemsWithResizeItems:YES];
}
- (void)reloadData{
    
}
- (CGSize)sizeThatFits:(CGSize)size{
    CGSize s = [self.flowlayout sizeThatFits:size resizeItems:YES];
    s.width = size.width;
    return s;
}
@end
